Firstly, they are not the exact same investment purely because the approach is different.
Secondly, define "beat"? If you're talking final ROI, yes, lump sum is better. If you're talking which one is the better investment, then periodic is better. Which do you care about more?
Note that ROI, IRR, CAGR values are all general metrics that tell you the return of your investment in different ways. (https://forum.lowyat.net/index.php?showtopic=3730638&view=findpost&p=76895955)
---
By definition the IRR is the rate at which the sum of the Present Value of your investment's inputs and outputs equal to zero, i.e. Net Present Value = 0. So, if you adjust everything to right now (Present Value), how much do I have to adjust so that my top-ups PLUS my final return so that adding them up will become zero? That "how much" is the IRR.
What is the Present Value? To understand this concept, you first have to realize that RM 1000 in your hands right now is more valuable than RM 1000 4 years later. This is called the
Time Value of Money. This is the reason why interest rates exist. If I have RM 1000 now, I can put it to use now rather than later (i.e. it has the potential to generate interest). When calculating current investment value and past top-ups, "present" is shifted to the beginning of the investment (initial investment).
Why total to zero? Because you want to find the rate where the breakeven point happens. Negative means you need to lose money to reach breakeven, and positive means you'll gain money to reach breakeven.
So how do you find the IRR? You can use approximations (or graphical methods) to find an acceptable number. A simple way to think about this is to first try the number 10%, and then trying 9% and 11% to see which one gets you closer to zero, and just keep trying till you get a fairly accurate zero. In Excel, the calculation stops at 0.000001 percent accuracy.
---
Back to the example I gave:
The IRR of the periodic investment is 5.87% and the ROI is 13.14%.
The IRR of the lump sum investment is 5% and the ROI is 21.55%.
Why is the periodic investment IRR higher but ROI lower? Because when trying out different rates to try and get breakeven, we find that IF we adjust all the money we invest AND the final value to the day we first started investing, a RATE of 5.87% per year will give us RM 18102.53.
So at 5.87% a year and you got RM 18102.53 in 4 years, how much would the investment have cost if you do lump sum instead of periodic? Easy: RM 18102.53/(1.0587^4) = RM 14409.98.
Is this a better investment? Sure, because although you spent RM 16000 over the 4 years, you did not have to cough up RM 16000 one shot lump sum right at the beginning! Remember money later on is worth less than it was before. Your RM 16000 over the 4 years at 5% PA (given your investment pattern) is the equivalent of a lump sum RM 14409.98 4 years ago at 5.87% PA. This also means that considering time value of money, the ROI is higher.
From another POV, you can say that IRR is used to tell you what returns different investments generate/generated when compared against a standard. You need to standardize before you can do meaningful comparisons.
---
IRR has some drawbacks and is not usually used alone. In this example, the two investments have the same duration of 4 years with the same annual return so you can use IRR to compare the two strategies. Also note that the "I" refers to "Internal", i.e. not taking into account external factors (risk, etc).
Again:
ROI, IRR, CAGR tell you different aspects about the return of your investment. As an investor, you have to know what you want and use these numbers to tell you if the investment is suitable for you.
Lump-sum will always win. Sure you can say that the RM1,000 you invest in the 4th year is worth less than the RM1,000 invested initially, but it's not by all that much.