I am trying to understand how some websites add the text ".store." before their domain when someone visits an online store side of their website. Usually this happens in cases where ecommerce is just a small part of a company's business.
Do companies like these have two websites? One having domain "www.business.com" and another "www.store.business.com"?
There is a distinction between domain and website.
Following your question business.com would be the domain. It is usually bough and registered with a registrar. Maybe you've heard of some, like NameCheap, GoDaddy or Google Domains.
Now, usually these registrars will let you create DNS (Domain Name Server) rules (records) that allow requests directed to your domain to reach your server(s), which in turn will respond with whatever was requested (a website, for example). You can look at these DNS rules as a kind of "phone book" that associates the URL you type in your browsers search bar with the address of the server that will take care of your request.
There are many types of DNS rules, but suffice to say that you can also add subdomains to them, i. e., the parts that come before your domain in the URL. www, for instance, is already a subdomain of business.com in www.business.com, albeit a very frequently used one.
Long story short, yes, companies can have multiple websites. They are just computers that will respond to your requests differently (one will give you the company's corporate website while another will respond with its e-commerce one). The DNS records are the ones that will direct those requests to the right servers, and these records can reference subdomains, all based on the same main domain. The company only really needs to own the domain; it's up to them to add subdomains to it and point them to a different server.