Tar repels water because it contains hydrophobic oils, resins, and heavy organic compounds that water does not easily penetrate or dissolve.
Water is polar, while many tar components are oily and non-water-loving. That basic mismatch makes tar useful as a water-shedding coating. Water tends to sit on the surface, bead, run, or enter only slowly through defects and porous areas.
The effect can be seen most clearly on fresh or maintained tar. Rain darkens bare timber quickly, but a good tarred surface resists that instant soaking. On rope, tar reduces how quickly fibres take up water. On boats and outdoor structures, this slowed wetting was historically valuable.
Water repellence is not the same as total waterproofing. Cracks, joints, end grain, pinholes, damaged spots, and poorly bonded coatings give water a route inside. Tar can slow water, but it cannot compensate for every construction problem.
Tar repels water best when it is continuous, bonded, and suited to the material. Once the coating is cracked or worn away, water follows the gaps, not the intention of the coating.