First, it's important to be clear with our terminology.
Secondary sources are sources that describe, discuss, interpret, analyze, comment upon, evaluate, or summarize primary sources.
Scholarly articles are secondary sources. However, not all secondary sources are scholarly. You may sometimes also hear scholarly articles and peer-reviewed articles used interchangeably. That is because peer review is a critical part of what makes something "scholarly."
Scholarly articles (and books, too!) are defined by two key criteria:
It is written by a scholar in their own field.
Typically, we consider someone to be a scholar if they have achieved the highest degree in their field. In the case of history, that would be a PhD. Often, they are faculty at a college or university or other academic institution. The scholar must also be writing in the field of their expertise. An article about history by a scholar with a PhD in chemistry would not be considered scholarly.
The writing has been through the process of peer review.
Peer review is a process by which research writing (articles, books) is vetted by peers--other scholars in the field--to ensure that it is interesting, credible, and contributing to scholarship in some way. Articles that get published in scholarly journals undergo peer review and editorial review, which generally focuses on style, readability, and fit. For scholarly journals, fit is ensuring that each journal is publishing articles relevant to the journals mission or editorial scope. This helps scholars find relevant scholarship. Scholars of women's history, for example, know that the Journal of Women's History will be filled with scholarship on the history of women.