The Head First
EJB book gives a good explanation, but if you don't have access to that book just think of code you can use and adapt at deploy time, i.e. without source code changes.
The adaptation could be through a deployment descriptor (the EJB approach), JavaBean properties (the AWT/Swing approach), injection (the Swing approach), or aspects (the AspectJ approach), maybe others that I'm missing... but the idea is that it is a hunk of compiled code with a well-defined set of services that you can use without the source but still adapt effectively to your needs.
EJB adds a bunch of other meat to the concept to support distributed components that make extensive use of container-managed services.