Have you ever bought groceries?
If you have, I’m pretty sure you never signed a contract nor asked the person on the till if they had the authority to enter a contract on behalf of the company. Notwithstanding, a contract is what you had with the grocery company; one that is legally binding on both you and that company.
(Most) contracts don’t need to be signed
Or, for that matter, be in writing
There are exceptions, most notably around real estate or finance, but the overwhelming majority of contracts don’t need a signature or even to be in writing. Many contracts are in writing even when that isn’t legally necessary for all sorts of good reasons but most B2C and even many B2B contracts are verbal or even simply performed - like you buying groceries.
Apparent or ostensible authority
An agent of a company (including employees) that reasonably appears to have the authority to bind a company to a particular course of action, including agreeing to a contract, has that authority even if they don’t. For example, when you buy your groceries, you can reasonably assume that the cashier has the authority to sell them to you.
Unless you know that someone is exceeding their actual authority or it is unreasonable for you to assume the agent is (for example if the cashier tried to sell you the grocery store), then the company cannot avoid their obligations to you. They can, of course, take action against an agent that exceeded authority but that doesn’t let them off the hook for what that agent did.
What authority a company gives its agents is up to it
A company can only act through its agents.
At the top of the tree are the directors and other officers, they have authority only limited by the law and the company’s rules. However, since outsiders don’t know the company’s rules (unless they have been explicitly told), their apparent authority is only limited by law.
The directors and officers can delegate authority to employees and other agents however and with whatever restrictions they wish. Such delegation may be explicit or implicit, for example, it’s implicit in a purchasing officer’s role that they can purchase things. However, an outsider is entitled to presume that an employee who acts like they have the company’s authority to do whatever they are doing, does have it.