Mikey has the right concept about how Monte Carlo simulation works.
In the case of modelling returns on various classes of investments, it does the following:
Say the user wants to model a ten year period, with 50% of assets in stocks and 50% in corporate bonds.
For the first year, the program generates a number representing the total return on stocks for that year. This number is "semi-random" in the sense that the program is instructed to generate numbers that will, collectively, have a mean (average) equal to the historical average annual return on stocks, with a standard deviation equal to the historical standard deviation of the annual returns on stocks. The program then applies this value to the 50% of the "portfolio" that is in stocks, to yield a year-end value for the stock portion of the portfolio.
In a similar fashion, the program generates a semi-random value for the return on bonds for year #1, and applies that to the 50% of the portfolio value that is invested in bonds.
The "new" values of the stocks and the bonds are then added, and an annual withdrawal amount selected by the user is subtracted. Then, the portfolio is mathematically "rebalanced" so that there is again 50% in stocks and 50% in bonds at the start of year #2.
This process is repeated for each of ten years, producing a particular value for the portfolio at the end of year #10.
This same process is repeated numerous times (500 in the case of the TRP model), producing a large set of different "possible" values for the portfolio at the end of year #10. The presumed "chance of success" is determined by the number of results that are greater than zero. For example, if 450 results are greater than zero, there is considered to be a 90% chance that the investment strategy would be successful in the sense of supporting the input withdrawal rate over a ten year period. But sometimes the program will produce, say, 441 "successful" results and sometimes it will produce, say, 465 "successful" results. And in an extremely rare case, it could produce 500 "successful" results with the same input data
!
From a standpoint of statistical purity, a problem with the relatively "simple" Monte Carlo model that I described is that it does not account for (a) correlation between returns on different asset classes (for example, the fact that annual stock and bond returns are somewhat correlated) nor (b) "serial correlation" within each asset class (the tendency for returns to vary cyclically from year to year).
I suppose that an professional statistician could create a Monte Carlo simulation that would take these statistical interrelationships into account, but I doubt that the TRP model does.
Interestingly, the FIRECalc model does account for these statistical interrelationships, to the extent that they are embodied in the historical data that FIRECalc uses. Conceptually, the major risk with FIRECalc is that the data that it uses might contain one or more extreme "outlier" years that would make its "worst case" results too pessimistic. But I don't think so, since I like to plan for what I consider to be a "reasonable worst case" scenario.