The point of a union is not job security. It's about giving workers collective power they may not otherwise have. Historically unions have been painted as extremely antagonistic towards companies in the United States, but there's no reason that has to be true.
A well-run union recognizes that their survival is tied to the company's survival, and as long as both sides engage in good faith, they should reach an agreement that's mutually beneficial. To your point about job security, no one I know in unions wants to keep all employees no matter what. What people want is protection from being fired for no reason. Usually that means something like getting a PIP and six weeks to improve performance. Is that such an unreasonable ask? That way the employee has a chance to keep their job, and the company can potentially avoid the expense of hiring and training a new employee.