Hi jim
It is very rare that commercial CDs have artist, title, song information on them. So regardless of the media player used , a connection to the internet is needed. The player reads the Disc ID # and then a query goes out to the online database (CDDB/Gracenote, etc) to retrieve all the song, album, year, etc data which is then displayed on your player.
It is possible that your experience where Foobar provides the information could be because that CD was played on your PC at an earlier time and the disc information is stored in a datafile on your PC for that CD.