How do academics change their area of research in the middle of their academic career? Often, I have come across profiles of tenured faculty members who are now doing research in completely different topics than what they had done in their PhD, postdoc or in the beginning of their academic career. For example, a professor in our department had done his PhD, postdoc and initial career in using molecular dynamics for nanomechanics. However, over the course of time he also added quantum mechanics (density functional theory) and continuum mechanics in his research. In other case, I have seen a faculty with an engineering-physics PhD related to thin films shift to working on 3D printing and developing aerospace materials.

My question is, how do academics change their area of research and what efforts goes into establishing oneself in a changed research area?

I have seen academics hire a PhD student to work on a new research area and learn as they guide the student. But, how can someone guide if the area of new research is very minutely related to their area of expertise.
There are two parts to this. The first is easy. If you are tenured then you just make the change, either immediately or gradually. Tenure gives you the freedom to do that. If you are untenured then you make the change and worry a lot about whether you will get tenured. 

There is, however, one scenario in which it is advantageous for even an untenured person to change. If you are the new hire in a department in which there is no one to collaborate with then it might be an advantage, even if you are untenured, to join a research group and move toward their interests. It could, perhaps, enhance tenure possibilities. 

The second part is a bit more complex, assuming you want to behave ethically. You can't really advise students very well if you have no knowledge, though a surprising amount can be accomplished. It is, in theory, possible to teach things that you don't know yourself, but you have to do it carefully, putting the student on a learning path that you haven't followed yourself. This is possible if you know about research and how to conduct it and are sophisticated enough to follow the arguments put forth by the student, just as you would the arguments of any colleague. I'll note that research groups actually do this - exploring a path that no one has followed. 

But if you change fields gradually then you can also work into the advising role gradually, perhaps by being a co-advisor of a few students - even if informally until you get the required background. 

I'll note that advising students outside your expertise, while possible, is risky and so the methodology used needs to remove risk for the student. A student, on the other hand, is best advised to choose an advisor who already has sufficient expertise in the direction to be followed in the research. 

Note also that at the end of doctoral research the student is actually expected to know more about the specific research area than the advisor, unless the student has brought the advisor along on the journey to the end. If the opposite were true we would never advance, with each student being somehow less than the advisor. 



Note that I've assumed here that the change is to a field that has similar research methodologies, such as changing subfields within a larger field. It is harder otherwise, of course. But the way we do mathematics or computer science is pretty similar within most subfields. Similar for chemistry, say. But to switch from math to history is a bigger challenge as the research methodologies are (I assume) much different.