Excommunication is an attempt to bring a presumed sinner back to his senses (from the perspective of the Church, not mine). He is denied communion (hence, he is excommunicated) and other sacraments, so much so that no sacramental ritual (e.g., mass) may take place in his presence.
But he is certainly not "thrown out" of the Church, nor is he told not to come back. Quite the contrary, the expected behavior is for him to rush back to the Church, confess his sins, obtain absolution, and ammend his ways.
This is at least the legal theory within the Catholic Church as codified in Canon Law (in which I have a degree from Gregorian University in Rome).
You are correct in your assessment of it being rare in these days, mostly because it generally does not have the desired effect anymore. A person who would be excommunicated in the days past could most likely care less nowadays, and since it is not likely to bring him back, he/she is not likely to be excommunicated anymore.
P.S. This was originally the second write-up of this node, hence the "you are correct" etc.