There are some reasons that HDFSstores data using commodity hardware despite the higher chance of failures:
HDFS is highly fault-tolerant.HDFS provides fault tolerance by replicating the data blocks and distributing it among different DataNodes across the cluster. By, default, replication factor is set to 3 which is configurable. In Hadoop HDFS, Replication of data solves the problem of data loss in unfavorable conditions like crashing of the node, hardware failure and so on. So, when any machine in the cluster goes down, then the client can easily access their data from another machine which contains the same copy of data blocks.
It provides distributed processing so that every datanode have sufficient process to do.
It has replicas of the block on different datanode so it is economical to store data on commodity hardware.
It provide HIGH AVAILABILITY features which mean that availability of data in all condition even in the case of machine failure.