Sniffing is information gathering
Dogs rely heavily on scent to understand their surroundings. When a dog lowers their nose to a patch of grass, they are collecting detail about that spot in a way we cannot easily observe. The behaviour is ordinary and self-directed: nobody teaches a dog to investigate, and most dogs will do it given the opportunity.