The phrase "to sniff the ground" means to inspect or investigate something carefully and thoroughly, similar to how a dog sniffs the ground to find clues or information about what's happening around them. Full definition
Most puppies will sniff the ground when they're getting ready to potty, but she may also pace, seem distracted and walk away subtly signaling a need to eliminate. (totallygoldens.com)
Mack — The Explorer: This is a doglike robot that is shown sniffing the ground as though he can search for things. (engagedfamilygaming.com)
Behaviors like sniffing the ground, circling, or pacing may mean that your puppy needs to go. (dogbehavioranswers.com)