I have done both and while there are similarities there are major differences.
The initial similarities are that both require a good amount of analysis and financial knowledge.
They also require you feeling comfortable that you can lose money and depending on the investment a lot of money.
Illiquid and long-term oriented.
May or may not be less capital intensive than stock investing.
Will typically need to be able to borrow money. This has positive and negative benefits as it provides leverage.
More tax implications than a stock investment.
Management headaches. Even if you hire a property manager you should still be involved to some degree.
Location, location, location is critical.
Need to understand where you are buying from location (what could happen in the neighborhood both short term and especially long term).
What are the comps for similar properties and what condition were they in.
What is the condition of the target property. Will you need to improve it initially or down the road (which you will have to just from a maintenance perspective).
Harder to diversify.
Larger transaction costs.
What are the potential returns.
Typically liquid. Long and short term timeframes (but typically shorter than real estate).
Can use leverage but that can riskier since if you receive a margin call you may have to sell and won't be able to wait for a rebound (vs. real estate you can if there is sufficient cash flow).
Taxes are due until you sell (except for dividends).
Greater need to stay on top of what the company and stock are doing (which can diverge from each other).
Need to understand the company, its products, its competitors, its financials (income statement, balance sheet, cash flow statement), what non-company events could impact the stock (such as the Federal Reserve).
What valuation is it selling at and how does it compare to peers (which can be a trap if it just looks cheap compared to similar companies. They all may be overvalued).
Easier to diversify.
Much smaller transaction costs
Do you want to buy individual stocks or a fund.
What sector or sectors or geographies do you want to invest in.
What size of companies do you want to invest in.
Overall while there are some similarities there are major differences.