Why microtubules grow and shrink