Psalm 78:1-2 announces that the speaker will open his mouth in a parable and utter things hidden from of old. In the psalm itself, this introduces a poetic retelling of Israel's history designed to instruct later generations through the lessons of God's dealings with His people.
Matthew 13:34-35 explicitly quotes Psalm 78:2 after describing Jesus' practice of teaching the crowds in parables. Matthew says that Jesus' parabolic teaching fulfilled what was spoken through the prophet. This makes the connection direct. Jesus uses parables not merely as illustrations but as a means of revealing the mysteries of God's kingdom while also exposing the spiritual condition of His hearers.