A droid is an artificially intelligent automaton built to perform a job in the Star Wars galaxy. Droids vary widely in form and capability, depending on their job requirements. A few types of droid (notably Cybot Galactica's 3PO series of protocol droids and Industrial Automaton's R2 Astromech Droids) are sapient.
Expense appears to be a significant factor in droid design, and the AI component seems to be a cost driver. Battle droids that are expendable and manufactured in large numbers appear to be quite stupid, while droids designed for sophisticated tasks like starship repair or medical functions seem to be much smarter.