X-Ray diffraction relies on the dual wave-particles nature of X-rays permitting to obtain lot of information about the structure of a crystal compound. Effectively this mode of characterization is only for organized, regular matter for instance a monocrystale.
The dominant effect which is producted when a X-Ray monochromatic incident beam interacts with organized matter, it product the diffraction of the beam.
William Lawrance Bragg and his father, are the initiators of X-Ray diffraction and have got the Nobel prize in 1915. William was just 25 years old!
So, he described the phenomenon and explained it according to the formula: 2dsinθ = nλ.
The directions of possible diffractions depend on the size, the shape of the cristalline structure. And the intensities of the waves which arrive at the detector depend on the kind and arrangement of the atoms in the crystal structure.
Consequently, the different positions of the pics, due to the impact on a screen, permit the identification of the analyzed sample.