It is indeed a one-way cap. If the can gets warm, the pressure inside it builds and vents the vapors until the pressure is about the same as atmospheric pressure. Then when it cools down, there is a lower pressure inside the can than from the atmosphere, but it can't equalize because of the one-way cap.
Same thing can happen with any container with a pressure change from temperature or from an elevation change.
If you open and close a water bottle at high altitude, then go to a lower altitude, the bottle will get squished in.
And by the way, plastic gas cans do NOT "breathe." Any pressure equalization is due to less effective sealing than the metal cans have.