how do automation systems work