Well, since this is quote generic query, I won't go into details.
How does a browser basically work?
By fetching and parsing the webpages, and then displaying (rendering) them to user to see. User can give input and take actions, and these will lead to other pages being displayed, or the content of the page being updated.
See
Wikipedia: Web browser for more.
But how does it decide what gets done first? for example if images, html and scripts are contained on a web page which items are actions taken on first?
Whichever happens to come first (
HTML is very structured markup language, elements are in certain ordered structure). Some elements might have higher priority than others, however. Some parts might depend on others to be 'resolved' first. Also, smart renderers first get enough information about all elements to know their sizes (if possible), and then figure out the layouting needed. After that the elements are rendered. If no size information is available, the page will be jumpy while loading (elements are 'dancing' as they're loaded and the layouting changes realtime).
Needless to say this is huge over-simplification. If you really want to know how simple web page renderer works, see
aweb source code.
On an Amiga hows does data get sent back and forth between the browser and the TCP/IP stack software?
bsdsocket.library - This is a dynamically created library that TCP/IP stacks create to memory. It has all the APIs needed to talk to the network stack.