Meaning of different bordersizes for <image>

What are the exact meanings and iteractions of all the 5s below (taken from <image> example from the Manual)?
I’ve played with them a bit, but I am still not sure.

Code:
<texture border="5" flipy="true" flipx="false">mytexture.png</texture>
<bordertexture border="5">mybordertexture.png</bordertexture>
<bordersize>5</bordersize>