Selenium WebDriver is used for automating web browsers by using the browser's internal plugins or dll with the individual browser drivers, which are available for each individual browser.
The following diagram shows the high-level functionality of Selenium WebDriver. The JSON API parses the instructions from languages like Java, Python, and so on, and invokes and operates on the concerned browser: