If it's at LHR, if you transit from a domestic arrival to another flight, you do not go through security at Heathrow as you have already cleared that at the origin airport with the UK. Similar, here in Spain, transiting at Madrid from an internal Spanish flight does not involve going through security again. At AMS, all security used to be at the gate, but I gather this has now changed so I am not sure how they operate there now.