Who says they were publicly visible?
There are many many many ways to get inside the firewall access to a corporate network. Maybe there's an out of date router at a satellite office. Maybe their web servers have a known exploit. Maybe you send a phishing email to their employees. Maybe you compromise a supplier's web site and it delivers malware to their PCs when they access it. Maybe you show up at their loading dock saying you have an Uber Eats delivery for "Clyde" and they say "there's no Clyde here" and you say "well I got a delivery for him, maybe he's a contractor or something?" and while they are distracted wondering who Clyde is or if they should just say they're Clyde to take that food that smells real good you spot a cat5 port and install a battery powered router you can access that night.
Most likely they were not publicly visible as that makes little sense. But once their corporate network was penetrated you can access the 10.x.x.x addresses assigned to the freezers from the 10.x.x.x addresses assigned to their web servers, office PCs or whatever. One should use firewalls to segment portions of an internal network from each other to mitigate such attacks, but a lot of companies don't. Probably especially companies like food distributors who don't see themselves as potential hacking targets.