Alfonso X of Castile is traditionally credited with requiring food to be served with wine in a story about the origin of tapas.
The medieval king, known as Alfonso X el Sabio, ruled Castile from 1252 to 1284. A popular account says that after recovering from illness, he ordered that taverns serve wine accompanied by a small portion of food. The practice was supposedly intended to prevent customers from drinking alcohol on an empty stomach.
That story is widely repeated in explanations of the word tapa, but historians do not treat it as a fully proven single origin for every modern tapas custom. Other origin stories connect tapas with pieces of bread or food placed over drink glasses to keep out insects.
The answer is therefore a traditional attribution, not evidence that Alfonso X personally invented every tapa. Modern tapas culture developed over centuries and differs across Spanish regions.