How is an out-of-trim condition (in relation to weight distribution) detected on the ground?
The most likely scenario, where you have an unforeseen deviation from plan at the last minute, is pax loading where due to a statistical fluke there is an uneven distribution of pax in the cabin, say because a lot of them didn't show up and the no-shows tended to concentrate toward one end.  

When the FAs inspect the cabin after boarding, they do a pax count and one thing they are looking for is a minimum number of pax in each cabin weight and balance zone.  If the FA sees something that is out of whack, like the front half of the cabin near empty with a crowd at the back, they will let the Capt know, and if necessary will start going around to pax to request them to change seats to address the under filled zones.

For cargo, the crew has to trust the people that loaded the cargo weight and balance wise.  For fuel, it's mostly about making sure the fuel load indicated in the cockpit matches the fuel load paperwork and the weight and balance load sheets and trip requirements.

In a line operation, the crew doesn't have to do any of the actual dirty work, they are just presented with the information prepared by specialists and review it to make sure it jives with expectations and requirements.