To factor $ x^2-x-ax+a $ we can use factoring by grouping.
Group $ \color{blue}{ x^2 }$ with $ \color{blue}{ -x }$ and $ \color{red}{ -ax }$ with $ \color{red}{ a }$ then factor each group.
$$ \begin{aligned} x^2-x-ax+a &= ( \color{blue}{ x^2-x } ) + ( \color{red}{ -ax+a }) = \\ &= \color{blue}{ x( x-1 )} \color{red}{ -a( x-1 ) } = \\ &= (x-a)(x-1) \end{aligned} $$