# What is the difference between the package-searching mechanism of PdfLatex and TexMaker?

I usually use TeXmaker to edit and compile my .tex files. I am trying to figure out where I should put the file my-package.sty, so that I can use it by simple adding \usepackage{my-package} to the preamble of any .tex file.

I found several related answers suggesting using kpsewhich and related commands, such as

However, on my system it seems that TeXmaker can find packages that neither kpsewhich nor pdflatex can find. For example, TeXmaker can compile the following file example.tex without error, and produces the correct output.

\documentclass{article}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\end{document}

But pdflatex example.tex generates the error message