Botnet can be definied as the network of infected computers. A botnet is a collection of internet-connected devices, which may include PCs, servers, mobile devices and internet of things devices that are infected and controlled by a common type of software called malware. Users are often unaware of a botnet infecting their system.
In basic language bots are program which are automated or you can say robotic. In simple context bots refer to those computers which can be controlled from the external source which may be programmed in them.
Now the attacker gains access to the computers by virus or any miscellaneous code. Most of the times computer are operating normally, so the malicious operations stay hidden to the user.