Electronic flat bands serve as a unique platform to achieve strongly-correlated phases. The emergence of a flat band around the Fermi level in 1T-TaS$_2$ in accompany with the development of a $sqrt{13}timessqrt{13}$ charge density wave (CDW) superlattice has long been noticed experimentally, but a transparent theoretical understanding remains elusive. We show that without CDW, the primary feature of the $1times1$ bands can be fitted by a simple trigonometric function, and physically understood by choosing a rotated $tilde{t}_{2g}$ basis with the principle axes aligning to the tilted TaS$_6$ octahedron. Using this basis, we trace the band evolution in the $sqrt{13}timessqrt{13}$ superlattice by progressively including different CDW effects. We point out that CDW strongly rehybridizes the three $tilde{t}_{2g}$ orbitals, which leads to the formation of a well-localized molecular orbital and spawns the flat band.