BA sells those LCY/LHR connections just as they sell LGW/LHR itineraries. Sometimes those connections will pop up as the quickest or cheapest option on top of the list of offered flights. Quite tricky for passengers who are not familiar with the London airport landscape.
The fact that BA now stickers boarding passes with a red "transfer" label suggests that connections are not really one-offs, but occur to a certain extent. If security is crowded, the sticker apparently allows the connecting passenger to jump the queue as the guard next to the security barrier will allow them to take a shot-cut to the nearest security lane.