It's just a convention:
Currency Pair Quotation Conventions
The base currency in a particular currency pair are often determined
by their importance in relation to other currencies.
For example, the Euro is generally considered the most dominant base
currency, followed by the Pound Sterling, the Australian Dollar and
the New Zealand Dollar. All of these serve as the base currency in
their currency pairs involving the U.S. Dollar, and they would be
written in currency codes like this: EUR/USD.
The U.S. Dollar then dominates as the base currency in virtually all
other currency pairs, including against the Japanese Yen, the Canadian
Dollar, and the Swiss Franc, as well as in currency pairs against the
exotic currencies. These currency pairs would generally be written
like this: USD/JPY.
So a USD/JPY quote means "buying USD in JPY", meaning you are paying an equivalent amount of JPY to get USD.
If you want to trade the other way around, meaning you want to pay USD and get JPY, just invert the FX rate, so a rate of 20 becomes 0.05. Note that you should also invert the bid/ask, meaning you would invert the USD/JPY bid if you are looking to buy JPY with USD.
If you get confused about the bid/ask, remember that you always pay the higher amount and sell for the lower amount.