When we "buy" something, we pay to gain possession of that item. We can also use "buy" for something intangible.
Example: Buy a dozen eggs. (tangible) / Money cannot buy true love. (intangible) / He was trying to buy her affection. (intangible)
It is an action where an exchange of value is performed.
================================================================================
Things are more interesting for "shop". The meaning varies depending on how you use it with other words: I can go "window shopping" for hours in a shopping mall without buying anything. All I am doing is to browse every store to occupy my time. I can also "shop around" to compare prices and end up not buying anything. I can "shop for" something by searching for a particular product to buy. When I really do "shop", I visit a shop (noun) or website to buy something or make an order by paying.
Shopping is more of a decision process on whether we should buy or not; buying is the act of deciding to pay so that something becomes ours.