Most tech companies have both, for example ours:
Docs: docs.usepylon.com
Knowledge Base: support.usepylon.com
Many companies typically end up having both a documentation site and a knowledge base since they serve two different purposes.
Docs are typically used as a prospect-facing tool to help showcase all the features in your product at a high level.
They are generally updated when there is net new product surface area and they are generally owned by the marketing and/or product teams.
Docs often don't get into specific details of behavior but rather try to showcase functionality.
Docs are often NOT a good place to put information about specific behavior, product limitations, or error scenarios since prospects may make buying decisions off of your docs.
Docs are also often NOT a good place to put specific information only users will find relevant, like information on updating account details or details about billing or payment.
A knowledge base is typically used by active users and customers of your product. Its goal is to help users resolve issues they run into while using your product or specific questions they have.
The knowledge base is typically owned by support or success folks on the post sales team and is typically updated when customer issues are resolved.
A knowledge base also often contains internal content in the form of runbooks or internal notes on article (only visible to your team).
A knowledge base is also typically the most useful content available for training AI to assist with customer questions, since it typically contains articles that stem from directly resolving past customer questions.
Tactically, teams often respond to customer questions with links to knowledge base articles.