The unique, information-carrying ability of DNA and RNA is closely tied to the specific hydrogen bonding interactions that occur between the bases.
In DNA, strong hydrogen bonding interactions occur selectively between guanine and cytosine (G-C) and between adenine and thymine (A-T). In RNA, G-C and A-U interactions are found. These interactions are shown in the figures below.
adenine thymine 3D structure
guanine cytosine 3D structure Notice how there are three hydrogen bonds between guanine and cytosine and only two between adenine and thymine. This makes the G-C interaction slightly stronger than the A-T interaction
Now what happens if we try to match up any combination other than A-T or G-C? As shown below, other combinations such as guanine-thymine do not lead to favorable hydrogen-bonding interactions.
guanine thymine