The point at which the float is placed in the source determines the placement of the float in the formatted document in the following way:
- The page on which this point in the source eventually appears in the formatted document will be the earliest page in the formatted document on which the float can appear. If the float is placed inside a paragraph, then this reference point is defined to be the next linebreak (compared to the actual placement in the source). If the float is placed between paragraphs then the reference point for the float is the end of the previous paragraph.
- It is possible (and in fact happens quite often) for the float to appear physically before this reference point but only through its placement in the top area of the same page.
- The moment LaTeX reaches the reference point in the source it will try hard to place the float as fast as possible, i.e., preferably on the same page.
The take-away from this that one normally should (at least initially) place a float close to its first main call-out, i.e., the place in the source where the float is referenced and one expects the reader to be interested in consulting the float material with ease. This is in most cases (but not always) the first reference to the float.
It is fairly easy to do this even within a paragraph, e.g.,
... some text. See figure~\ref{foo} ...
%
\begin{figure}
... \caption{..}\label{foo}
\end{figure}
%
... some more text in the same paragraph
However, even with the additional lines containing just a % this is somewhat difficult to read (and to maintain) and in most cases with minimal gain. So my advice is to initially place such floats always between paragraphs following the paragraph that contained the main call-out. When the document is in its final stage (with respect to its content). The float placement could then be adjusted if necessary.
Update
Perhaps I should explicitly mention that "between paragraphs" doesn't mean at the end of paragraphs, e.g.
...last sentence.
\begin{figure}
...
Instead always leave a blank line between the last sentence and the figure. Otherwise you might see some strange paragraph breaks if you are unlucky! The reason is the following: normally TeX removes white spaces at the end of the paragraph and then appends \parfillskip. This is done because such a space is normally not intentional at this point. However if the figure directly follows the paragraph text then it is effectively not "between" paragraphs but at the very end of the paragraph (seen in horizontal mode). As a consequence any space after the last word in the paragraph is hidden from TeX's mechanism as there is this figure following it. Thus the space remains and if you are unlucky enough this extra space makes an otherwise perfectly fitting last line become overfull, so that TeX then generates another line for that pragraph.