In Wordpress, We can have links to add product to the cart which is required sometimes especially when sending campaign links to promote product or course and providing buy product option.
Ex: https://www.yourwpdomain.com/?add-to-cart=3016&quantity=1
Will add product with id 25 to the cart with qty 1
https://www.yourwpdomain.com/?add-to-cart=3016&quantity=3