A router often hears about the same network from multiple places: a connected interface, a static route you typed, and a routing protocol like OSPF. It can only install one of them as the best route. Administrative distance is the tiebreaker — a trust ranking where lower is better.

The AD table (memorize this)

Connected interface ....... 0
Static route .............. 1
EIGRP (internal) .......... 90
OSPF ...................... 110
IS-IS ..................... 115
RIP ....................... 120
External EIGRP ............ 170
Unusable (never installed)  255

How it's used

Say a router learns 10.5.0.0/16 from both OSPF (AD 110) and a static route (AD 1). The static route wins and goes in the table; the OSPF route is held in reserve. If the static route's next hop goes away, OSPF's version can take over.

AD vs metric — don't confuse them

AD compares different sources. Metric compares routes within the same protocol (OSPF cost, EIGRP composite, RIP hop count). The router first picks the source by lowest AD, then — among that source's routes — picks the best by metric.

Floating static routes

You can deliberately raise a static route's AD above a protocol's (e.g. set it to 200) so it only installs when the protocol-learned route disappears. That's a floating static — a clean backup path, and a favourite exam scenario.