Session beans encapsulate business logic for enterprise applications. It's a good idea to use session beans when developing enterprise applications, since we as application developers can focus on developing business logic, not having to worry about other enterprise application requirements such as scalability, security, transactions, so on and so forth.
Note
Even though we as application developers don't directly implement common enterprise application requirements, such as transactions and security, we can configure these services via annotations.
There are two types of session beans: stateless and stateful. The difference between the two of them is that stateful session beans maintain conversational state with their client between method invocations, whereas stateless session beans do not.