These expressions have the same root "ОДИН" which means ONE.
They are, in fact, adjectives and change the form according to the gender of the name that follows.
Ex.: один и тот же компьютер, одна и та же еда, одно и то же событие. That means we have only one object (though it might be something not material, like a thought, for ex.)
Одинаковый/ая/ое/ые - this word supposes that we have 2+ objects to compare. Ex. Эти ботинки одинаковые (that means these shoes are both left, or both right)))