"what exactly lowers your ping? "
Shorter Distance between you and the (game) server, that is by far the main factor, plus traffic management, routing, you have no control over those.

They try and sell fancy hardware to gamers as some believe almost anything.

A wired Ethernet connection is better than Wireless. Wireless has greater errors thus data needs resending causing additional delays.

No fancy hardware will put you closer to the game server, it is like a difference of say 40.00 ms to 40.01 ms.