How to explain your failure to HR?
While sharing the Failure, structure the answer in Context, Action and Result format. This helps listener to understand the full details of the situation and one gets the chance to share the action steps taken. Failure in results can also be explained when we structure discussion in this fashion.
Also one should not hide or try to mask failures but should tell that you did whatever was in your control to manage things better.
In addition to what has been already mentioned,I would say, one must add what did they learn from the failure and how that has helped them in future/ going to help in future?