As Henning Makholm says, there is a transfer bus between the terminals. One half of the bus is for passengers in the Schengen sector, the other half for passengers in the non-Schengen sector. The halves are blocked off from each other by a glass wall, and at each stop (which is located either in the Schengen or non-Schengen sector), only the doors in the "correct" half of the bus will open.
So you don't need to enter Germany, and, unless holding a nationality requiring an airport transit visa, you don't need a visa.
This is provided the trip is in a single booking. With separate bookings, if you have checked luggage you need to enter Germany to collect it, and thus need a short-stay (type C) Schengen visa. And even with only hand luggage, ground staff in the UK will usually treat Germany as your final destination, and deny you boarding without a short-stay Schengen visa.