matplotlib.pyplot.show如何工作?

I want know how matplotlib.pyplot.show works. But I've searched multiple articles, and the matplotlib code and I can't find anything that shows how the matplotlib GUI works. I want to know how they made the matplotlib GUI so I can have a better understanding of GUIs and how they work and how to make them without tkinter.