For non-UK residents, this is a perfectly normal thing that happens regularly[1]. For example the last government did it to David Cameron, who was not an elected MP at the time he was made foreign secretary.
To become a minister, that person needs to be an official politician. Part of the House of Commons or the House of Lords. So if a sitting UK government wants an expert in their cabinet who is not an MP, they ennoble them. They make the person a Lord to get them to be able to operate officially as a minister in the government.