What are factors to consider when evaluating buying a business that has a leased location vs buying a business + buying the property that the business is located on?

Could someone help me understand how to determine if buying a business with a leased location is a good investment?