You have more people in urban areas who do not produce anything. That is where Kenya defeats you, We have fewer people in urban areas (a cultural thing) but who produce 10X what you produce in far more complex jobs than the simple jobs in Tanzanian cities.
Also the largely rural parts of Kenya form the backbone of Kenyan economy.
Nyandarua a county that is largely rural produces more horticulture than the whole of Tanzania combined, they are also in the top five richest counties in Kenya.
Kericho a largely rural county is the largest tea producer in east and central africa with millionaires who would never want to step in the city.
Naivasha in Nakuru county is largely rural but is home to the second highest number of hotels after mombasa and home to the world famous Kenyan floriculture which earns Naivasha about kes 70 billion annually.
Kenya has more developed cities and urban centres than Tanzania but majorly people prefer to live in rural areas to make money from Agriculture. That is why Kenyan agriculture is worth almost triple that of Tanzania.
Uasin gishu county, home to eldoret town, very few people want to live in eldoret town majority are wheat farmers, maize farmers, avocado farmers and dairy farmers. They go to the eldoret town to buy machines for their farms and electronics(Yes the farmers have electronics that would be a luxury in Tanzanian cities).