The major difference between these two pieces is when in the Elastic Beanstalk deployment process they are run.
These commands are run early in the deployment process, before the web server has been set up, and before your application code has been unpacked:
By default, the commands run in the root user's home folder. This and various other pieces of EB's behavior can be changed via options (working directory, whether to continue on error, environment variables to pass to commands, etc.) that can be passed along with the commands
Container commands run after the application and web server have been set up and the application version archive has been extracted, but before the application version is deployed. Non-container commands and other customization operations are performed prior to the application source code being extracted