1 Both quantum optics and physics of ultracold quantum gases are well-established fields of modern quantum science forming the basis for emerging quantum technologies, quantum information, and quantum artificial intelligence. Nevertheless, until recently the interaction between them was practically absent: in all experiments and in the majority of theories of ultracold gases, the quantum nature of light plays no role. In this work, we consider systems and phenomena, where the quantumness of both light and ultracold matter is equally important. Therefore, quantum optics of ultracold quantum gases describes the ultimate quantum level of light-matter interaction predicting phenomena unobtainable in standard problems of ultracold atoms trapped in prescribed optical potentials, e.g., optical lattices.First, we show that light can serve as a quantum nondemolition (QND) probe of the atomic many-body phases: the phases can be distinguished by measuring their statistical properties from nontrivial correlation functions to full distribution functions of many-body variables (we give examples for bosons, fermions, and dipolar molecules). We demonstrate that light scattering is not only sensitive to the on-site atomic densities, but also to the matter-field interference at its shortest possible distance in an optical lattice. Second, we prove that the backaction of quantum measurements constitutes a novel source of competitions in many-body systems, which is especially pronounced, when the measurements are not QND ones. This leads to a plethora of novel phenomena: macroscopic oscillations of multipartite entangled matter modes, measurementinduced protection and break-up of fermion pairs, generation of antiferromagnetic orders, novel long-range pair correlated tunnelling and entanglement beyond the standard Hubbard models. We prove that the feedback control can induce phase transitions in quantum systems and tune their critical exponents and universality class. Third, the quantization of optical trapping potential (quantum optical lattices) leads to novel many-body phases of ultracold atoms, including both the density orders (e.g. lattice supersolids and density waves) and orders of matter-field coherences (e.g. bond orders such as superfluid and supersolid dimers, trimers, etc.)The general results applicable beyond physics of ultracold atoms are the following. We extend the paradigm of feedback control from the quantum state control to the control of phase transitions, including tuning their universality class. We present the backaction of quantum measurements as a novel source of competitions in many-body physics. We merge the paradigms of quantum Zeno dynamics and non-Hermitian physics, and introduce a novel type of quantum Zeno phenomena with Raman-like transitions well beyond the standard concept of Zeno dynamics. We propose a concept of quantum simulators based on the collective light-matter interaction with the interplay of long-and short-range interactions. Our models can be applied to other arrays of quantum particles...