Based on @DavidCarlisle 's answer (which relies on roman page numbers being used) and his comment, I have created a document with arabic page numbers:
\documentclass[11pt]{article}
\usepackage[proportional]{libertine}
\begin{document}
There is nothing of interest on this page.\clearpage
There is nothing of interest on this page.\clearpage
There is nothing of interest on this page.\clearpage
There is nothing of interest on this page.\clearpage
There is nothing of interest on this page.\clearpage
There is nothing of interest on this page.\clearpage
There is nothing of interest on this page.\clearpage
There is nothing of interest on this page.\clearpage
There is nothing of interest on this page.\clearpage
\begin{figure}[!t]
\centering
\framebox(260,420){}
\caption{A figure to take up space}
\end{figure}
Here is some text referring to something in section \ref{mylabel} (which starts on page \pageref{mylabel}).
\section{A very interesting section\label{mylabel}}
The text of an interesting section.
\end{document}
The font used in this document is Linux Libertine with proportional
figures. "proportional figures" means that the characters 0123456789 do not have the same width. For example, 0 is (slightly) wider than 1.
The sentence Here is some text referring to something in section \ref{mylabel} (which starts on page \pageref{mylabel}).
on page 10 just fits in one line if \pageref{mylabel}
is 11, but it occupies two lines if \pageref{mylabel}
is 10. (This is because 0 is slightly wider than 1.)
Now the following happens: If the sentence refers to page 11, it fits in one line and the section fits on page 10. If the sentence refers to page 10, it occupies two lines, the section does not fit on page 10 and is moved to page 11...