renamed folder becomes a file with an extension
Folders can have a suffix too. If your OS X System knowns the file extension, it will change the icon (after renaming) and link it to the App that can handle that extension (and is set as default App to open those file types).

The folder then becomes a package or container, where you cannot easily look inside by browsing in finder. But you can right-click on it and choose "Show Package Contents" to see what is inside. 



Sometimes the (folder-) file extension is hidden by System Default (as for iPhoto Library containers).