Each ring shown is aromatic: its p-orbitals overlap all the way around, so the π-electrons are not stuck in fixed double bonds — they are delocalized into one continuous cloud above and below the ring plane (the translucent disc). Hückel's rule counts them: 4n+2 π-electrons make a ring aromatic. Pyridine contributes 2 electrons from each of 3 C=C/C=N double bonds (6 total). Furan, pyrrole and thiophene are 5-membered, so a lone pair from the heteroatom (O, N or S) joins two double bonds to reach the same magic number, 6.
The heteroatom itself decides reactivity: pyridine's nitrogen keeps its lone pair out of the ring (in the plane, not delocalized), making it a base like ammonia. Pyrrole's nitrogen instead donates its lone pair into the ring to complete the aromatic sextet, so it is a much weaker base and needs an N-H hydrogen to satisfy its valence.