This is part of Japan's tax system. If you are not a Japanese tax resident, capital gains from selling Japanese stocks may be taxed differently, or not at all, under the rules of your own country.
How it works
Tax is charged, under separate self-assessment taxation (see related page), on the profit remaining after subtracting the acquisition cost and fees from the sale price of stocks or other securities. If you use a "with withholding" specific account, the brokerage automatically calculates and collects the tax.
Things to watch for
Gains within a NISA account are tax-exempt, and the treatment otherwise differs depending on the type of account used. Please confirm the exact calculation and whether a filing is required with the Japanese tax authorities (NTA) or a qualified tax accountant.
