Electron-hole pairs can be generated through various means, including thermal excitation, optical excitation (photons), and electrical excitation. In nanotechnology, quantum dots and other nanomaterials are often engineered to optimize the generation and control of these pairs for various applications.