In short
ROI is the ratio of the net gain from an investment to its cost and shows how profitable the investment is.
In software and automation projects, ROI is calculated from reduced downtime, scrap, inventory and labour costs, and from added capacity. Payback period is the indicator most often requested alongside ROI.
A realistic ROI requires measuring baseline values before the project starts.