The parameter axis=1
refer to columns, while 0 refers to rows. In this case you are sorting by columns, specifically index 1, which is col2
(indexing in python starts at 0).
Some good examples here: https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.sort_values.html