That's a great question about a feature many of us see daily but might not think about! The locking mechanism on this model of public trash can is actually quite clever in its simplicity. Primarily, it's designed to prevent vandalism, unauthorized access, and to control the schedule for waste collection.
Most commonly, you'll find a sturdy, stainless steel hasp and a recessed point for a padlock. The hinged lid has a metal loop or bar that, when closed, aligns with a fixed loop on the main body of the bin. A city maintenance worker or authorized collector simply inserts a padlock through both loops to secure it. The design is often "recessed" or shielded to make it difficult for someone to cut the lock with bolt cutters.
The key goals are security and efficiency. By locking the bin, cities prevent people from dumping large, improper items (like household garbage) into public bins, which can overflow and create mess. It also deters animals from scavenging. The mechanism allows crews to unlock all bins on a route with a single key or combination, empty them quickly, and relock them, keeping the public space neat and secure until the next collection cycle. It's a low-tech but highly effective system for urban management.