I am wondering conceptually how load-balancing works on the EJB-level (not web session replication) with Java EE containers like Glassfish. From what I have gleaned your remote
If things fail are they supposed to be able to "finish" on another server?
Failover (you are referring to failover here, not load-balancing) is not part of the spec as far as I know. However, most vendors support failover and multiple EJB containers can be clustered to provide this feature. Basically, the progress of each open transactions is transmitted to backup server(s) and, if the primary container fails while the transaction is still open, a backup server can take over and, under some circumstances, it might be able to continue the transaction (for example, WebLogic requires methods to be declared as idempotent). Most often, the backup container will rollback the transaction and signal the client to retry its original request.
I want to understand the basic theory behind this load balancing, why is it better than a bunch of servers all running a plain web application with session affinity on a load-balancer?
Too much concepts mixed up here to provide an answer. Failover != load-balancing, session affinity is not really related to failover (it just means a request will be send to the server which holds the session). Failover can be achieved at the web layer using HTTP Session state replication (in-memory replication, in database, etc). You need to clarify the question.