Maybe find the smallest one and read through its code?

Lynx is where I would start, or see:

https://lobobrowser.org/

since it's all in Java and presumably is straight-forward.