Welcome to Just Answer! Thank you for giving me the opportunity to assist you! I will do my best to help!
FIRPTA (Foreign Investment in Real Property Tax Act) is designed to make sure that foreign persons pay tax on the sale of US real property. Normally, foreign persons do not pay tax on capital gains. However, Congress passed laws (FIRPTA) to cause foreigners to pay tax on the disposition of US real property. This tax and the associated withholding are found under IRC §897.
The withholding tax is 15% of the gross proceeds. However, when you file your income tax return, you can get a refund of the part of the tax that is allocated to the cost basis. This will insure that you only pay tax on the actual gain (as opposed to the gross proceeds).
California's law is similar, and will result in a refund of the over paid tax once the tax return is filed.
Basically, this is a big stick to encourage foreigners who sell US real property to file tax returns. By overwitholding, they are forcing you to file in order to get your overpayment back. IF you don't file, they have extra tax revenue.
I hope this answers your questions! IF you have any more, please feel free to ask and I will be happy to answer.
Thanks! Have a great week!