Customs and passport officials control the vehicles there because the border is a border between the Schengen area and the rest of Europe, Slovenia being part of said Schengen area while Croatia is not yet.