Sometimes, your solar electric system will generate too much energy—more than you need at that time. (This can happen during the summer, for instance.)
At other times, your system won't generate enough power. (For example, at night.)
Grid tying is one solution.
When you tie into "the grid", you are trading electricity with PG&E (or your local utility).
You sell your excess power in high-yielding times (like summer), and buy back power when you can't generate enough (like at night).
Assuming your set-up is calculated correctly, you should break even each year, selling to the utility as much as you buy back.