  We study the influence of strong spin-orbit interaction on the formation of
flat bands in relaxed twisted bilayer WSe$_2$. Flat bands, well separated in
energy, emerge at the band edges for twist angles ($\theta$) near 0$^{\circ}$
and 60$^{\circ}$. For $\theta$ near 0$^{\circ}$, the interlayer hybridization
together with a moir\'{e} potential determines the electronic structure. The
bands near the valence band edge have nontrivial topology, with Chern numbers
equal to +1 or $-$1. We propose that the nontrivial topology of the first band
can be probed experimentally for twist angles less than a critical angle of
3.5$^{\circ}$. For $\theta$ near 60$^{\circ}$, the flattening of the bands
arising from the K point of the unit cell Brillouin zone is a result of atomic
rearrangements in the individual layers. Our findings on the flat bands and the
localization of their wavefunctions for both ranges of $\theta$ match well with
recent experimental observations.
