They are called vortex generators, and their function is to create a small vortex which re-energizes the boundary layer. Here is a better picture which also shows that their leading edge is swept like that of a delta wing:

Vortex generators on a T-45 (picture source)
In essence, they are small wings which each create their own delta wing vortex. This vortex mixes fast-moving air from outside the boundary layer with the air close to the wing surface, which has been slowed down by friction. This helps
- at low speed to delay flow separation at high angle of attack
- at high speed to avoid an oscillation of the shock position when the supersonic pocket of flow over the wing is decelerated in a shock which can cause local flow separation.
The diagram in your question about "Leading edge vortexing" is very misleading. Air does not flow like shown by those arrows.
An airfoil initially accelerates the air which flows over its top surface and decelerates it again over its rear part. On swept wings, this acceleration-deceleration only affects the orthogonal speed component, so the speed component in span direction remains unaffected. This is the reason for the higher Mach capability of swept wings, but also causes the air to flow first inwards and then outwards while transversing the wing's upper surface. The diagram shows no such inward flow, which is wrong.
In addition, friction decelerates the air flowing around a body, such that a layer of decelerated air surrounds each surface of an airplane. The thickness of this boundary layer increases with flow length, and on a swept wing this friction will initially mostly affect the orthogonal flow component. At around mid chord you will find air which has been decelerated mostly in its orthogonal speed component (since this component was so high over the forward part) and now will be subject to more deceleration of the orthogonal component, so that only the spanwise component will be left over the rear part of the boundary layer. Now this boundary layer will only flow off in span direction, such that a massive increase of slow, low-energy air will be collecting towards the tips.
A thick boundary layer will cause early flow separation, so when the angle of attack is increased, the flow at the tips of a backward swept wing will separate first. This will cause lift loss, and since the tips are also the rearward part of the wing, will shift the aerodynamic center forward. This in turn will make the aircraft pitch up, which aggravates the stall condition. If the separation happens asymmetrically, the aircraft will roll in addition to pitching up.
Both vortex generators and wing fences help to reduce this cross flow and delay flow separation on the outer wing at high angle of attack. Vortex generators also help to prevent boundary layer separation past a shock at transsonic speeds when placed close to the leading edge, something a wing fence is incapable of. Therefore, they are more helpful and have displaced wing fences on many swept wings.