Most of the western countries consider Bitcoin an asset, similar to shares for example, and therefore you have to pay capital gains tax when selling it for a higher amount than what you acquired them for.
Some countries see Bitcoin as a legal tender, like El Salvador, so what you are saying as an example applies here, you are literally exchanging different types of money, so there's no capital gains tax in El Salvador.
Like anything important, it's difficult to explain it in simple terms.