Magazines and newspapers have ads of different sizes and different issues of the same publication don't always have the exact same template each issue, so I assume they layout the different sections according to the advertisement requests and content for each issue.
My question is, how do they arrange it so they all fit in each issue? What happens if you get a request for one extra ad, be it one whole page or a small quarter page ad, that they have no space for on existing pages and therefore need to have it's on page, and since 1 sheet of paper has 2 pages, there would be at least 1 whole page empty? Say I have 10 pages including the covers. Then someone requests a quarter page ad that would require a whole sheet of paper by itself. How do magazines and newspapers manage to have all their pages filled perfectly every issue, no blanks that would otherwise be earning money through advertising, yet not a single ad too much that would then require a whole new sheet of paper (ie 2 pages)?