For faculty teaching the basic sciences, one gets a PhD, does a post-doctoral fellowship and either by picking up some teaching experience as a TA or a post-doc, OR scores a grant and has decent publications, then applies for and auditions at a medical school.
For clinical faculty, they can sometimes go right from residency to a Faculty position. Or, they may do a fellowship, which like a post-doc position, and may or may not include clinical responsibilities.
"Academic Medicine" can run the gamut to a clinician doing nothing but teaching, to teaching + seeing patients, to the latter + doing research, or the former + doing research. I've known doctors who have done all four variations.