How do trading algorithms work?

I am really curious to know about it. Please help.