The graphicx package allow the insertion of external images (in png, jpg or pdf format using pdflatex, or eps format using latex) with the \includegraphics command, but this has nothing to do with the figure environment, that can be used without any package, and without any image:
\documentclass{article}
\begin{document}
\begin{figure}
\hfil (whatever)
\end{figure}
\end{document}
That is, the figure environment is not an image, as the table environment in not really a table. Both are floats, unbreakable containers that can move from the actual position to fit well on top or bottom of the present page, or move to the next page if this is not possible, according to some options and complex rules. For a full understanding of floating mechanisms, see How to influence the position of float environments like figure and table in LaTeX?.
The numeration of the float is due to the optional \caption{...} command, that will increase the float counter and print "Figure x" or "Table y" plus the argument (the {...} part), that is, \figurename plus \thefigure, or \tablename plus \thetable, according to the type of float where it is placed, without regarding the float content:
\documentclass{article}
\begin{document}
\begin{figure}
\hfil (whatever)
\caption{caption of whatever}
\end{figure}
\end{document}
In both floats types, the content of the float is up to you. It can be almost anything except another float (a nested float is a contradiction in its own terms, and of course, will produce a fatal error), so the content can be an image in a table environment, or a table tabular environment in a figure environment, or absolutely nothing, or some text with or without a caption, or a minipage, ... or a tikz draw, that answer the question in verbose mode, but not better than the @leandriis comment:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows}
\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=white]
\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=white]
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=white]
\tikzstyle{arrow} = [thick,->,>=stealth]
\begin{document}
\begin{figure}\centering
\begin{tikzpicture}[node distance=2cm]
\node (in1) [io] {unit cell};
\node (pro1) [process, below of=in1] {vc-relax (pw.x)};
\draw[arrow](in1)--(pro1);
\end{tikzpicture}
\caption{A tikz figure}
\end{figure}
\end{document}
tikzpictureinside of afigureenvironment. – leandriis May 12 '20 at 19:54graphicxpackage has nothing to do with the figure environment and caption numeration. Demonstration:\documentclass{article} \begin{document} \begin{figure} \hfil whatever \caption{caption of whatever} \end{figure} \end{document}– Fran May 12 '20 at 20:05