Browsers that implement CSS for rendering HTML make use of user-agent default stylesheets (which have a low precedence in the cascade making them trivial to override in your own CSS). This is how they obtain default styles for various elements in absence of an author stylesheet.
Some vendors provide the source code of their UA default stylesheets so you can look at them and see how exactly certain browsers style certain elements by default. You can find some links in this question.
Most browsers provide a user stylesheet feature, where you write CSS that applies to all Web sites (or only to specific sites, via the @document
rule). This is where !important
is commonly and acceptably used, as author styles (i.e. styles that come from Web sites themselves) will typically override user styles. You generally don't want to modify a browser's user agent stylesheet at all, even if it's open source, unless you're planning to fork it into something entirely new and you need to add styles that are specific to that fork.
As for how a browser looks for a style definition: that's a very broad question, but it mainly involves looking at each stylesheet as well as any inline style attributes and resolving the cascade and any other environmental constraints accordingly, so as to obtain a value that it can use for the actual drawing. The cascade itself is a semi-broad topic, and how exactly a browser parses CSS and implements cascade resolution is an implementation detail and therefore highly dependent on the browser you're looking at. If you're interested in the gory details, Tali Garsiel has an incredible write-up of the entire process of receiving and displaying a Web page.