Autorun.inf is a file which is helpful in running applications directly from your plugin storage devices like pen drive, cds, external hard disk, dvds etc.
It contains information and has the ability to direct windows to run a specific .exe file so that automatically a screen pops up whenever you connect a external device
Why it is detected as malware?
Normally all autorun.inf is not detected as malware because they are programmed to run a specific .exe which is potentially not harmful. But when it is programmed to run a malacious .exe file it gets detected as malware.