Dilation

How does dilation really work? Is it more of how your cervix is or the active you are, you start to dilate during those closer weeks?