Have you asked it yourself? What business does Pelosi have traipsing all over the world, costing the taxpayers millions of dollars? Name a country - she has probably been there, and on the taxpayer's dime. But why? What is her function?
She is a congressperson (1 of 435 representatives, or 535 people if you count the senate) who was elected by a relatively small number of people to represent THEM. She does not represent me, nor does she represent you if you're not in her district. Is it the function of a congressperson to travel the world at the people's expense? WHAT is she doing? What is the purpose of her visits? She is not an ambassador, she is not a negotiator. She is a congressperson from one out of hundreds of districts who represents a relatively small number of people. I never see anybody question these trips or the justification and authority behind them. It seems most Americans will put up with just about anything, without question.
Congress writes legislation all the time that deals with and interacts with other nations on Earth. They could be trade deals, economic discussions informing legislation, military cooperation which has to get funding and certain decisions by Congress. They could be discussing commodities when figuring out bills to deal with supply issues worldwide. She could be discussing microchip production and what it would take to build more in the US, or have Taiwanese companies come build in the US. Some members of Congress are on the foreign affairs committee, so would even moreso be working directly with foreign nations.
Regardless of if these examples are factually true in regards to current world events, these are examples of things Congress has to deal with and it includes dealing with foreign countries. Speaker of the house is one of the key positions what would go to other countries to discuss legislation or other policy topics.