One of the reasons we all love Java is its portability across multiple platforms. The whole write-once-run-anywhere (WORA) thing.
EJB takes portability to a new level, instead of write-once-run-anywhere, it’s write-once-deploy-anywhere (WODA). Just as WORA frees you from being forced to work on a single OS, WODA frees you from being at the mercy of your application server vendor. And then of course there’s YODA, but we digress.
In the old days, each application server vendor had its own proprietary API. You learn it, work with it, and finally get your enterprise apps up and running. And then guess what? You need a new feature. And then guess what? Your vendor says, “We’re considering that for Q3... of next year”. Now what? Like a drug dealer, they’ve hooked you, and now it’s just too painful to consider giving them up. Give them up for what? Another vendor and another proprietary API and more lock-in.
One of the crucial benefits of EJB is WODA. And now the vendors have to compete not just to sell you in the first place, but to keep you. Because as everybody knows, you can just pack up your beans and go elsewhere.