A basilica is simply an important church building designated by the pope because they carry special spiritual, historical, and/or architectural significance. Once named a basilica the church can’t lose its status as a basilica. A basilica may or may not also be the cathedral of the diocese. This is the highest permanent designation for a church building.
A cathedral is the church where the bishop’s throne (called cathedra) is located. It is the main church of a diocese. A cathedral may or may not be a basilica. It is the home church for the bishop or archbishop of a Catholic diocese while a basilica may also be the cathedral in the diocese there is no requirement for it to be so. For example, The University of Notre Dame has the Basilica of the Sacred Heart on its campus but it is not where the Cathedral is located.