The maximize button (top left – 3rd button to the right on the window) hides the top bar and dock automatically in OsX. If you want to make a window cover the whole screen without covering the dock and top bar, use the following key combinations:
Option + (click on green button on top left) – This maximizes the window vertically, useful for some apps that dont require as much horizontal space
Shift + Option + (click on green button on top left) – This maximizes the window to cover both horizontal and vertical space