To answer your question, a foreclosure is actually a legal proceeding whereby a lender is executing their right to take possession of a property for nonpayment on a mortgage. After the specified period, (about 111 days in California) and on a date set by the trustee by direction of the investor, the home is set to sell at auction on the courthouse steps.
You can buy it on the courthouse steps. Most realtors are not assisting those sales. It's not trivial. You need to drive by the property (it might still be occupied so you are trespassing to get too intrusive...the homeowner may still live there). You may not be able to see inside, the condition of the home, nor know if it is still occupied. You have limited knowledge on whether there is clear title on the property. if there is a general lien against the homeowner, such as for back taxes, that lien is not cleared in a foreclosure, and may not show up in a quick title inquiry. Buying the home can mean you are responsible for those existing liens still. (while subordinate private liens, such as mortgages, are cleared, government liens aren't) So there are lots of risk, but possible rewards on buying on the courthouse steps. And you have to buy it for cash, payable at the time of sale. If the home is occupied, you need to follow state laws in evicting the homeowner.
If it is not sold on the courthouse steps, the lender takes back ownership of the property as an REO- Real Estate Owned property. These are sometimes sold directly by the lender, and more often by Realtors through the MLS. In this case, you would get clear title when you buy it, don't have to pay cash and have time to investigate the condition of the property. You will most likely also have competition, but plenty of time to remove any risks.
I caution you on assuming a home listed on a website such as Trulia, is actually for sale. Realist posts the notice of foreclosure, which is one notification in the legal process but does not mean the home is for sale...yet.
I would suggest you post the property that you are interested in. The respondents can give you detailed information about the property here, as to whether it's actually ready for sale, or just a foreclosure posting. And of course, you can see there are plenty offering to help.