Relativistic charged particles, known as cosmic rays (CRs), are the primary contributors to the nonthermal energy budget in the universe. These CRs are believed to be accelerated in collisionless shocks, which are ubiquitous in astrophysical environments and have also been investigated in laboratory experiments. While the main acceleration mechanism --- diffusive shock acceleration --- is well-established, the processes responsible for injecting thermal particles into diffusive shock acceleration mechanism and converting them into nonthermal particles remain poorly understood. In this talk, I will discuss our recent efforts to address this challenge using first-principles kinetic plasma simulations of non-relativistic shocks. I will focus on electron acceleration and highlight the critical role of self-generated plasma instabilities in both the injection of particles and the enhancement of the energy of nonthermal particles. Finally, I will introduce a toy model to illustrate our findings. This study is critical for developing subgrid recipes for nonthermal processes at shocks and for interpreting the phenomenology of nonthermal radio, X-ray, and gamma-ray emission across the universe.