What is chromedriver:
chromedriver has code that can interact with browser. THis commands are exposed through an API ( This is what you see as chromedriver started on localhost:14563 ) . From the code we access this api endpoints to tell chrome driver to do something.
Example, when you say elem.click() , selenium talks to the API and tells chromedriver to click the specified elem in the browser. And chrome driver does it and returns response from browser and give it back to out code
Why we need base class
This is to ensure driver sessions are passed among different classes. Else you won't be able to do something like
Because if you have different driver session for page1 and page2,
then once you start page2.adduser() chrome driver will be started newly and your previous login sessions will not be available so you have to login again
Also you cannot add screenshots or driver-specific actions in listener classes for reporting
You can read more about base class at :
What is the purpose of creating a BaseTest class which declares a global static WebDriver object in POM framework?