Could someone explain the difference between encoder-only and encoder-decoder models in the context of question answering?

What is the difference between two types of transformer models (encoder-only vs encoder-decoder) and how they are used for answering questions?