In my experience, there are four things which affect your chances of getting an upgrade.
The first, and easiest to arrange, is being a member of the loyalty program for that hotel chain. You'll often need to be at least off the bottom rung to get a very good upgrade, and suites tend to only come for people with the highest status. However, when deciding who gets the room overlooking the bins or the one right next to the lifts, being in their loyalty program should be enough to stop you getting one of the less-good rooms if nothing else!
The second, is how you book. Booking through certain travel agents, for example American Express Fine Hotels and Resorts or a Virtuoso linked travel agent can get you guaranteed upgrades (along often with dining or spa credits). Only certain properties tend to be covered, and there are often eligibility requirements to book through those channels (eg you need an Amex Plat or Centurion card to book through FHR), but if you qualify and the hotel you want is in the list, it's a great option.
The third is how long you stay. If you're on a very short stay and it's busy, they might upgrade you as they're short on standard rooms that night, need to upgrade someone, and would prefer not to upgrade someone staying longer who'd then keep the nice room for longer. If you stay for a long time and they're quiet, they may choose to upgrade you to say thank you for your long stay at a quiet time. (Long stays at busy times, and short stays when quiet tend not to get upgrades, except through the other routes mentioned)
Finally, how often do you stay there? If you stay with the chain a lot, you'll get status which'll help (see #1), but if you stay in that hotel often they'll notice. If you're a regular, you can often expect an upgrade, maybe even a welcome drink, and generally be treated well as they appreciate you keep coming back. This is the most reliable way to get upgrades and VIP treatment, but the hardest...!
(I've rarely, but not never, been upgraded in chain hotels when at their lowest tiers. I've had excellent luck with upgrades with SPG Gold and Hilton Gold, whilst now Hilton Diamond it is even better. FHR rarely works for my need, but when I've booked those I've always had upgrades. My best upgrades have tended to be long stays at quiet times combined with hotel chain status. My "regular" hotel always gives me a quiet room with a nice view, but sadly all their rooms are the same size so that's the only upgrade available!)