Text compression is looking for patterns in text so that you can store those patterns, rather than the original content in order to reduce the file size of the text.
Data compression is the general task of compressing any kind of information to save on bandwidth for transmission or file size for data storage, both of which used to be a lot more limited than today, to see how expensive and limited storage used to be, see this article.