The difference between NETBIOS and NETBEUI

What is Network Basic Input Output System (NETBIOS)? What is its function with regard to communication in a Local Area Network (LAN)? What does NetBIOS extend User Interface do? What is its role in the context of a LAN? How are the two terms different in what they do? Given that both help in communication which one is better and why?
