Op amp with transistor in feedback
Operation of this chip is clever but not too difficult to understand.




Current flowing to the load will cause a voltage drop between (1) and (2) and the drop will be proportional to the current.
Since the op-amp input impedance is very high, the voltage at (3) will be  same as (2). (More on this later.)
Initially the transistor will be off and voltage at (4) will be equal to that at (1). The effect will be that (4) is higher than (3) so the output of the op-amp will start to increase.
As the output starts to increase the transistor starts to turn on. This allows current to flow through Rg3. As the current increases the voltage at (4) starts to drop due to Rg1.
When enough current is flowing through Rg1, Q and Rg3 to pull (4) down to the same voltage as (3) the circuit will stabilise.
Therefore the voltage across Rg3 will be proportional to the voltage across Rsense which is proportional to the current. The Rg3 voltage is buffered out.
Rg2 is included to balance out any bias currents. Both inputs will be affected the same amount so the errors cancel out. They may also provide a little over-voltage protection and limit the current into any over-voltage protection diodes built in. (Check the datasheet.)



  If I were to build this from semidiscrete elements, can the op amp be powered from voltage ie. 5V and sense current on a lot higher potential with this circuitry?


Nope. With very few exceptions op-amp inputs must be within or very close to the supply rails. They do seem to be using a trick on this device though as pins 3 and 4 can go to 30 V with a 24 V supply on the chip (judging by the schematic.)