A report is presented on the investigation of the influence of in situ annealing of the InGaAs layer in p-n InGaAs/GaAs structures grown by the metalloorganic chemical vapor deposition upon the formation of coherently strained three-dimensional islands. The structures were studied by the methods of capacitance-voltage measurements, deep-level transient spectroscopy, transmission electron microscopy, and photoluminescence. It is established that three-dimensional islands with misfit dislocations are formed in the unannealed structure A, while quantum dots are formed in the annealed structure B. The deep-level defects were investigated. In structure A, defects of various types (EL2, EL3 (I3), I2, HL3, HS2, and H5) are present in the electron-accumulation layer. Concentrations of these traps are comparable to the shallow donor concentration, and the number of hole traps is higher than that of the electron traps. On the in situ annealing, the EL2 and EL3 defects, which are related to the formation of dislocations, disappear, and concentrations of the other defects decrease by an order of magnitude or more. For structure A, it is established that the population of the quantum states in the islands is controlled by the deep-level defects. In structure B, the effect of the Coulomb interaction of the charge carriers localized in the quantum dot with the ionized defects is observed.