First let us understand about Replication factor. The replication factor represents number of copies of a block that must be there in the cluster. This value is by default 3 (comprises one original block and 2 replicas). So, every time we create a file in HDFS will have a replication factor as 3.
You can check the replication factor from the hdfs-site.xml fie from conf/ directory of the Hadoop installation directory.
hdfs-site.xml configuration file is used to control the HDFS replication factor.
Hdfs-site.xml looks like the following and you can change dfs.replication property to modify the default replication factor to all the files of HDFS.
If you wish to learn Hadoop from Industry experts, you can enroll in this Hadoop Certification course by Intellipaat.
I recommend watching this video on how HDFS works to understand in detail: