As far as I know a PostDoc in USA is 2 years of research program. Habilitation is 4-8 years program. So, why is this difference in time frame?
What are advantages/disadvantages of Habilitation over PostDoc in case of academic career?
PosDocs usually work on someone else's research programs. Often the program is an incremental or partial step in a larger research framework. Postdocs have some independence in choosing the methods for their research, but are largely supervised/trained by their PIs or mentors. Postdoctoral projects can be rather technical in nature. They usually result in a few journal publications. It is very likely that your colleague next door did or will do a few postdoctoral projects during their career.
Habilitation is a large piece of work focused on a large problem, performed completely independently by one person. It usually contains major theoretical breakthrough (e.g. a completely new methodology) and results in a number of journal publication and at least one major "manuscript" publication (e.g. book). It is not so likely that a random academic next door did a Habilitation (because in most countries PhD is a terminal degree and Hab. does not exist).
tl;dr: Postocs and Habilitation are completely different programs.
A Habilitation is a qualification level (not quite like an academic degree but you can think that it is sort of a grand PhD with additional teaching).
A Habilitation used to be the formal qualification level to become Associate Professor and Full Professor. The position of an Assistant Professor (German "Universitätsassistent") was usually the time when you worked on obtaining the Habilitation.
In the meantime the Habilitation is a bit outdated.
You could also think the Habilitation as the successful completion of your Assistant Professor time i.e. postdoc positions are usually before and you usually cant start your Habilitation time before you completed several postocs.