It's cultural knowledge passed down through generations. Mushroom foraging is super popular in Russia and other Slavic countries, and my grandmother taught me most of the fundamentals before we immigrated to the US, and I continued to study field guide books on my own.
When you get to know the specific bits of anatomy of the mushroom body, the trees with which they're symbiotic, the seasons in which they occur, etc., then identifying different varieties becomes as clear as identifying a baseball vs. a tennis ball.