I worked for a large company (thousands of employees) and was laid off with almost twenty others on my team because we had basically completed the project that we had been working on for some years. We were given notice that it would be happening a month in advance, some of us were asked to stay on longer (with pay of course) for knowledge transfer purposes. They had meetings going over all the expectations, all the necessary paperwork, tax implications, etc.
It was all very civilized, nobody got booted out. People finished up their immediate work and gave training sessions to the people that were going to be staying on to maintain the project. Everything went smoothly.