Your financial institution doesn't necessarily know your capital gains. It reports stock sales to the IRS, but often doesn't report the cost basis because it doesn't know. Consider:
You buy 50 shares of ABC on Jan 1 2020. Then you buy 50 more shares on Jan 1 2022. Now you sell 50 shares of ABC on Jul 1 2022. Which bunch of shares did you sell? Was it a short term gain or a long term gain? Was it a loss? It depends. Neither your broker or IRS knows the answer, but you do.
EDIT: The above information is evidently out of date by about 10 years. TIL
Your broker does know because you need to tell them which ones to sell when you sold.
The IRS also knows because that's included in the cost basis reported to them by the broker. (This changed some number of years ago, brokers used to only report the income from the sale but not the cost.)
https://www.spencerlawfirm.com/2011/01/new-cost-basis-report...
For reasons I can't comprehend, ETrade reports the costs basis wrong every single year on all my RSU and ESPP sold shares. They do issue a supplemental report which has all the correct info, but the 1099-B has it wrong. It is maddening. I need to send both the 1099 and the supplemental doc to my CPA so things are accounted correctly, otherwise I'd pay a lot more taxes due to ETrade errors.
All other brokers I deal with do it correctly.
Employment compensation related shares get weird, but they will at least track the purchase date or the date it entered their system anyway.
Things get more complicated when you are trading the same security across different brokers because they can’t detect wash sales. The IRS has the information to detect was sales.
Edit: To pre-empt some replies: yes, centralized exchanges will report sales but they won't always know your cost basis, and a lot of the trades will happen on-chain, which definitely isn't automatically reported.
To be clear, I support the IRS doing as much as the filing as possible, and I agree these issues aren't dealbreakers, but please don't make the situation look different than it really is.
Besides, as others have pointed out, there are ways to specify at the time of the sale. That's what Schwab does when I sell stock there.
Two things:
1. A lot of asset sales should be or are reported by financial institutions, so in the case of me selling stock through Schwab or whatever, it should still be handle-able by the IRS.
2. Okay yes, it's reasonable for me to put in my living status changes or tax deductions I want to claim, but they don't ask just for that, they ask for all the other shit too, all the stuff they already know the answer to. Why?