Much of what is said above is true.
IF you have particular preferences -- starboard, forward, midships, covered balcony, whatever -- then you need to book a specific cabin from the get go, and have your TA "lock" that cabin, mark it DO NOT UPGRADE.
It is true that cruise lines will often offer an upgrade with the chance to refuse it. OTOH I have also seen upgrades given without even asking, even at the port. In some cases they have been very nice upgrades, but in other cases have moved pax from cabins they particularly liked to a more expensive, but in their eyes less desirable cabin. For example, those prone to seasickness might be best in a midships cabin on a low deck. An "upgrade" to a more expensive cabin, but forward and on a higher deck, might not suit them at all.
But if you do not really care about choosing a particular cabin location, then booking a guarantee can work very well for you. That is what we usually do and we almost always get an "upgrade" -- at least, we almost always get a cabin in a higher category than the minimum that we booked. Most of the time it is from inside to a higher inside, outside obstructed to outside unobstructed, balcony to higher balcony or so on. But on some occasions we have gotten very nice upgrades such as from obstructed outside to a balcony. Why? See my post about the "upgrade fairy" above. We have no idea why.
In many cases we have been offered "upsells" and turned them down, then still gotten a cabin assignment higher than the one we guaranteed but lower than the one we turned down. So technically that was a free upgrade.
It is all a huge balancing and merchandising act. Getting something for nothing always gets peoples attention. Essentially it still remains just a gamble. If you think you have figured out how to beat it, then I want to know your system for the roulette wheel too..