I have three mongo nodes which I specify in the url which I use in the MongoClient. It looks something like this "mongodb://A,B,C,D". I need the read preference as Secondary, for which I used SECONDARY_PREFERRED. Everything works as expected, I am able to connect to the secondary node without any problem. I get the connection using -
mongo_con = MongoClient(db_url, read_Preference=ReadPreference.SECONDARY_PREFERRED)
I was wondering what the impact is if I don't send the 'replicaSet' optional parameter while getting the connection. What will be the difference in the connection, in case I use the repicaSet and send the correct replica set name, what if I send an incorrect replica set name? How will it impact my connection?
I was wondering what the impact is if I don't send the 'replicaSet' optional parameter while getting the connection.

This depends on the driver (pymongo/node etc.) you are using and how many seeds you specify in the connection string.
When given a single seed, some drivers assume you want a direct connection to that server only and some drivers discover the topology of the deployment and, if it is a replica set, would discover all of the other nodes and "connect to the replica set".
The behavior is currently being standardized across drivers via the directConnection URI option.
When you provide replicaSet URI option, you are forcing the second behavior of discovering the replica set in all drivers. Providing multiple seeds also works as long as you are not in a single-node replica set.

What will be the difference in the connection, in case I use the repicaSet and send the correct replica set name, what if I send an incorrect replica set name? How will it impact my connection?

If you specify replicaSet and give an incorrect set name, the driver will filter out all servers that have the correct set name (or from the driver's perspective, your instructed replicaSet is the correct one and the one reported by servers would be wrong). Your application will fail to find any usable servers.
pymongo MongoClient without replicaSet parameter