When you create a tablespace, you specify the path and name of the datafile. This is how Oracle determines it is a datafile. You can give it any extension you wish.